import React, { useState } from 'react'

import './index.scss'

import { View } from "@tarojs/components"
import { NoticeModal } from '../NoticeModal'

export default (props: any)=>{
    const [vis, setVis] = useState(false);
    return (
        <View>
            <View className="xxm-notice-ls" onClick={() => setVis(true)}>
                <View className="xxm-notice-ls__layoutname">{props?.notice?.layoutName}</View>
                <View className="xxm-notice-ls__content">{props?.notice?.strcutData[0].name}</View>
            </View>
            {
                vis && 
                <NoticeModal 
                vis={vis} 
                onClose={() => setVis(false)} 
                title={props?.notice?.strcutData[0].name} 
                content={props?.notice?.strcutData[0].content}
             />
            }
        </View>
    )
}
